<link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
<form>
  <aside class="lg-side">
    <div class="panel-heading tab-bg-dark-navy-blue okr-tab-head tab-right "></div>
    <div class="inbox-body mi-h8">
      <div class="row">
        <div class="col-lg-12">
          <section class="panel">
            <header class="panel-heading add-heading">
              会议纪要信息
            </header>
            <div class="panel-body">
              <div class="form-group customerForm">
                <label class="col-sm-2 control-label">会议开始日期*</label>
                <div class="col-sm-10">
                  <input id="time" type="text" value="" name="metTime" placeholder="日期选择" class="form-control"
                    onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
                </div>
              </div>
              <div class="form-group customerForm">
                <label class="col-sm-2 control-label">会议时间段*</label>
                <div class="col-sm-10">
                  <input type="text" value="" name="setime" id="setime" placeholder="例如:9:30-11:00" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
                </div>
              </div>
              <div class="form-group customerForm">
                <label class="col-sm-2 control-label">会议主题*</label>
                <div class="col-sm-10">
                  <textarea class="form-control" name="title" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" maxlength="50"
                    placeholder="字数限制(50字以内)">例会</textarea>
                </div>
              </div>
              <div class="form-group customerForm">
                <label class="col-sm-2 control-label">会议纪要*</label>
                <div class="col-sm-10">
                  <textarea class="form-control" name="content" id="content" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" oninput="autoTextAreaHeight(this)" maxlength="1000"
                    placeholder="字数限制(1000字以内)"></textarea>
                </div>
              </div>
              <div class="form-group customerForm">
                <label class="col-sm-2 control-label">参会人员*</label>
                <div class="col-sm-10">
                  <textarea class="form-control" name="partakeUser" placeholder="例如:张三、李四" maxlength="120"
                    onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');"></textarea>
                </div>
              </div>
              <p class="default-buttons">
                <a href="javascript:void(0);" class="button-back btn btn-info" onclick="toBack()">返回</a>
                <a href="javascript:void(0);" class="button-next  btn btn-info submit">提交</a>
              </p>
            </div>
          </section>
          
        </div>
      </div>
    </div>
  </aside>
</form>
<script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script>
  //时间控件
  $('#time').datepicker({
    format: 'yyyy-mm-dd'
  });

  function autoTextAreaHeight(o) {
      if((o.scrollTop + o.scrollHeight)>98){
          o.style.height = o.scrollTop + o.scrollHeight + "px";
      }
  }
  $(function () {
      var ele = document.getElementById("content");
      autoTextAreaHeight(ele);
  });

  var myDate = new Date();
  $("#time").val(myDate.getFullYear()+"-"+myDate.getMonth()+"-"+myDate.getDate());
  $("#setime").val(myDate.getHours()+":"+myDate.getMinutes());

  function toBack() {
    toLoadHtml(49);
  };
  $(".submit").on('click', function () {
    var arr = $("form").serializeArray();
    var data = {};
    for (var i = 0; i < arr.length; i++) {
      data[arr[i].name] = arr[i].value;
    };
    data.proId = proId;
    if (data.metTime == "" || data.metTime == null || data.metTime == undefined) {
      layer.msg("会议开始日期不能为空！");
      return;
    }
    if (data.setime == "" || data.setime == null || data.setime == undefined) {
      layer.msg("会议时间段不能为空！");
      return;
    }
    if (data.title == "" || data.title == null || data.title == undefined) {
      layer.msg("会议主题不能为空！");
      return;
    }
    if (data.content == "" || data.content == null || data.content == undefined) {
      layer.msg("会议纪要不能为空！");
      return;
    }
    if (data.partakeUser == "" || data.partakeUser == null || data.partakeUser == undefined) {
      layer.msg("参会人员不能为空！");
      return;
    }
    $certusUtils.ajax("addMeeting", {
      "params": JSON.stringify(data),
      "projId": proId
    }, function (response) {
      layer.msg("提交成功");
      toLoadHtml(49);
    });
  })
</script>